<template>
  <div style="height: 100%; display: flex; flex-direction: column">
    <div style="background-color: aqua">头部</div>
    <div style="display: flex; flex: 1">
      <div style="width: 150px; background-color: orange">
        <!-- <router-link :to="{ name: 'myhome' }">Home</router-link>  -->
        <button @click="toHome">home</button>
        <br />
        <router-link to="/about">about</router-link>
        <br />
        <router-link to="/user/xxx">user</router-link>
      </div>
      <div style="flex: 1; background-color: cornsilk">
        <router-view></router-view>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { useRouter } from "vue-router";

const router = useRouter();
function toHome() {
  router.push({ name: "myhome" });
}
</script>

<style scoped></style>
